package test_new;

import java.io.IOException;

public class ExceptionExample {

	public static void main(String[] args) {
		try {
			int i = calc1(11);
			int k = calc1(6);
		} catch (Exception e) {
			
		}
		System.out.println("Tampam");
	}

	private static int calc1(int i) throws IOException {
		try {
			return calc(i);
		} 
		finally {
			System.out.println("Very important!!!");
		}
	}

	private static int calc(int i) throws IOException {
		if (i == 11) {
			System.out.println("i = " + i);
		}
		if (i == 10) {
			return 86;
		}
		if (i == 5) {
			return calc();
		}
		if (i == 6) {
			throw new RuntimeException();
		}
		return 0;
	}

	private static int calc() throws IOException {
		throw new IOException();
	}

	
}
